import request from '../plugins/request';

// 动态相关接口
export const addDynamic = (data: any) => {
    return request.post('/dynamic/add', data);
};

export const deleteDynamic = (dynamicId: string) => {
    return request.post(`/dynamic/delete/${dynamicId}`);
};

export const getDynamicList = (params: any) => {
    return request.get('/dynamic/list', { params });
};

export const getDynamicDetail = (id: string) => {
    return request.get(`/dynamic/get/${id}`);
};

// 评论相关接口
export const addComment = (data: any) => {
    return request.post('/comment/add', data);
};

export const deleteComment = (commentId: string) => {
    return request.post(`/comment/delete/${commentId}`);
};

export const getCommentList = (dynamicId: string) => {
    return request.get(`/comment/list/${dynamicId}`);
};

// 点赞相关接口
export const addLike = (data: { dynamicId: string; liked: boolean }) => {
    return request.post('/dynamic/like', data);
};

// 分享相关接口
export const addShare = (data: any) => {
    return request.post('/share/add', data);
};

export const deleteShare = (shareId: string) => {
    return request.post(`/share/delete/${shareId}`);
};